package net.mingsoft.document.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.mingsoft.dashboard.action.q.sharing.SharingCheckPwdQuery;
import net.mingsoft.dashboard.action.r.FileShareResponse;
import net.mingsoft.document.entity.FileShareEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author gengfa
 * @date 22/01/19
 */
public interface FileShareDao {
    /**
     * 插入分享实体
     * @param entity 实体
     * @return 分享结果
     */
    int insertOne(FileShareEntity entity);

    Page<FileShareResponse> selectFileShareListByUserId(@Param("page") Page<?> page, @Param("userId") long userId,
                                                        @Param("createdDate") String createdDate);

    Page<FileShareResponse> selectFileShareListByReceiver(@Param("page") Page<?> page, @Param("receiver") long receiver,
                                                          @Param("createdDate") String createdDate);

    int updateShareStatus(List<Long> shareIds);

    FileShareEntity selectByIdAndPwd(SharingCheckPwdQuery query);
}
